// 声明一个常量,表示token的key
const tokenkey = 'heima-toutiao-token'

// 存
const addToken = obj => {
  localStorage.setItem(tokenkey, JSON.stringify(obj))
}

// 取
const getToken = () => {
  return JSON.parse(localStorage.getItem(tokenkey))
}

// 删
const delToken = () => {
  localStorage.removeItem(tokenkey)
}

export { addToken, getToken, delToken }
